<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>传送门后台管理系统</title>
<link href="tools/adminbootstrap/css/bootstrap.css" rel="stylesheet">
<link href="tools/adminbootstrap/css/site.css" rel="stylesheet">
<link href="tools/adminbootstrap/css/bootstrap-responsive.css"
	rel="stylesheet">
<script src="tools/adminbootstrap/js/jquery.js"></script>
<script src="tools/adminbootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="tools/jqueryUi/jquery-ui.min.css">
<script src="tools/jqueryUi/jquery-ui.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#dialog").dialog({
			autoOpen : false
		});
	});
	function setweb(ob) {
		var rowPointer;
		$("#dialog").dialog("open");
		$("#webId").val($(ob).parent().parent().parent().parent().parent().children().eq(0).html());
		$("#webName").val($(ob).parent().parent().parent().parent().parent().children().eq(1).html());
		$("#webAddress").val($(ob).parent().parent().parent().parent().parent().children().eq(2).html());
		$("#webBigType").val($(ob).parent().parent().parent().parent().parent().children().eq(3).html());
		$("#webType").val($(ob).parent().parent().parent().parent().parent().children().eq(4).html());
		$("#webExplain").val($(ob).parent().parent().parent().parent().parent().children().eq(5).html());
	}
	function deleteweb(ob){
	        form = $("<form></form>");
	        form.attr('action',"admin_deleteweb");
	        form.attr('method','post');
	        input1 = $("<input type='hidden' name='webInfo.webId' />");
	        input1.attr('value',$(ob).parent().parent().parent().parent().parent().children().eq(0).html());
	        form.append(input1);
	        form.appendTo("body");
	        form.css('display','none');
	        form.submit();
	}
	function dialogNo() {
		$("#dialog").dialog("close");
	}
</script>
</head>
<body>
<div id="dialog" title="数据修改">
	<form action="admin_setweb">
		<input type="hidden" id="webId" name="webInfo.webId">
		<table style="width: 100%; text-align: center;">
			<tr>
				<td>
					<div class="input-group-ml">
						<span class="input-group-addon">网站名称</span><br> <input
							id="webName" name="webInfo.webName" type="text" class="form-control">
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="input-group-ml">
						<span class="input-group-addon">网站地址</span><br> <input
							id="webAddress" name="webInfo.webAddress" type="text"
							class="form-control">
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="input-group-ml">
						<span class="input-group-addon">网站分类</span><br> <input
							id="webBigType" name="webInfo.webBigType" type="text" class="form-control">
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="input-group-ml">
						<span class="input-group-addon">网站类型</span><br> <input
							id="webType" name="webInfo.webType" type="text" class="form-control">
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="input-group-ml">
						<span class="input-group-addon">网站说明</span><br> <input
							id="webExplain" name="webInfo.webExplain" type="text" class="form-control">
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<input type="submit" class="btn btn-info" value="确认">
					<input onclick="dialogNo()"  type="button" class="btn btn-info" value="取消">
				</td>
			</tr>
		</table>
		</form>
	</div>

	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container-fluid">
				<a class="btn btn-navbar" data-toggle="collapse"
					data-target=".nav-collapse"> <span class="icon-bar"></span> <span
					class="icon-bar"></span> <span class="icon-bar"></span>
				</a> <a class="brand" href="webnavigationsystemadmin">传送门后台管理系统</a>
				<div class="nav-collapse">
					<ul class="nav">
						<li><a href="webnavigationsystemadmin">主页</a></li>
						<li class="dropdown"><a href="#" class="dropdown-toggle"
							data-toggle="dropdown">用户<b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><a href="admin-adduser">添加用户</a></li>
								<li class="divider"></li>
								<li><a href="admin-setuser">查询用户</a></li>
							</ul></li>
						<li class="dropdown"><a href="#" class="dropdown-toggle"
							data-toggle="dropdown">网站<b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><a href="admin-addweb">添加网站</a></li>
								<li class="divider"></li>
								<li><a href="admin-setweb">查询网站</a></li>
							</ul></li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span3">
				<div class="well sidebar-nav">
					<ul class="nav nav-list">
						<li class="nav-header"><i class="icon-user"></i>用户</li>
						<li><a href="admin-adduser">添加用户</a></li>
						<li><a href="admin-setuser">查询用户</a></li>
						<li class="nav-header"><i class="icon-signal"></i>网站</li>
						<li><a href="admin-addweb">添加网站</a></li>
						<li><a href="admin-setweb">查询网站</a></li>
						<li class="nav-header"><i class="icon-wrench"></i>配置</li>
					</ul>
				</div>
			</div>
			<div class="span9">
				<div class="row-fluid">
					<div class="page-header">
						<h1>
							查询网站<small>更新</small>
						</h1>		
							<div class="controls">
								<form action="admin_selectweb-webname" method="post">
								网站名称:<input type="text" class="input-xlarge" id="selectStr"
									name="selectstr" /> <input type="submit" class="btn"
									value="查询" />
								</form>
								<form action="admin_selectweb-webbigtype" method="post">
								网站分类:<input type="text" class="input-xlarge" id="selectStr"
									name="selectstr" /> <input type="submit" class="btn"
									value="查询" />
								</form>
								<form action="admin_selectweb-webtype" method="post">
								网站类型:<input type="text" class="input-xlarge" id="selectStr"
									name="selectstr" /> <input type="submit" class="btn"
									value="查询" />
								</form>
							</div>
					</div>
					<hr>
					<table class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th>ID</th>
								<th>网站名</th>
								<th>网站地址</th>
								<th>网站分类</th>
								<th>网站类型</th>
								<th>网站说明</th>
								<th>操作</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="session.allweb" status="stat" var="saw">
								<tr class="list-users">
									<td><s:property value="#saw.webId" /></td>
									<td><s:property value="#saw.webName" /></td>
									<td><s:property value="#saw.webAddress" /></td>
									<td><s:property value="#saw.webBigType" /></td>
									<td><s:property value="#saw.webType" /></td>
									<td><s:property value="#saw.webExplain" /></td>
									<td>
										<div class="btn-group">
											<a class="btn btn-mini dropdown-toggle"
												data-toggle="dropdown" href="#">操作<span class="caret"></span></a>
											<ul class="dropdown-menu">
												<li><button onclick="setweb(this)">
														<i class="icon-pencil"></i>修改
													</button></li>
												<li><button onclick="deleteweb(this)">
														<i class="icon-pencil"></i>删除
													</button></li>
											</ul>
										</div>
									</td>
								</tr>
							</s:iterator>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<hr>
		<footer class="well"> &copy;by_zj </footer>
	</div>
</body>
</html>